<template>

    <div id="index">
        <div class="container" style="height: 600px; border: 1px solid #eee">

            <div class="main-container">
                <header class="header" style="text-align: right; font-size: 12px">
                    <div class="dropdown">
                        <i class="icon-setting" style="margin-right: 15px"></i>
                        <div class="dropdown-menu">
                            <div class="dropdown-item">查看</div>
                            <div class="dropdown-item">新增</div>
                            <div class="dropdown-item">删除</div>
                        </div>
                    </div>
                    <span>王小虎</span>
                </header>

                <main class="main">
                    <router-view></router-view>
                </main>
            </div>
        </div>
    </div>
</template>

<style scoped>

a {
    text-decoration: none;
}
.container {
    display: flex;
    height: 600px;
    border: 1px solid #eee;
}

.aside {
    width: 200px;
    background-color: rgb(238, 241, 246);
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.menu ul {
    list-style: none;
    display: flex;
    gap: 20px;

}

.menu ul li {
    padding: 10px;
    text-decoration: none;
}

.menu ul li a:hover {
    background-color: #f0f2f5;
    color: #409eff;
}

.dropdown {
    display: inline-block;
    position: relative;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.dropdown-item {
    padding: 8px 16px;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.main {
    flex: 1;
    padding: 20px;
}
</style>

<script>
import myMenu from '@/components/myMenu.vue';
export default {
    name: "index",
    data() {
        const item = {
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
        };
        return {
            tableData: Array(20).fill(item)
        };
    },
    components: {
        myMenu
    },
};
</script>
